# coding: utf-8
from enum import unique

from common.constant import StatusEnum


class FriendStatus(object):
    """
    create by ld_wu 2018-01-08
    """
    DEFAULT = 0
    INVITED = 10
    APPROVAL = 20
    WAITING = 25
    PASS = 30

    mapping = {
        INVITED: '已邀请',
        APPROVAL: '通过验证',
        WAITING: '等待验证',
        PASS: '已添加'
    }


class RelationshipState(object):
    # 可邀请（非万屏用户且未邀请）
    CAN_INVITE = 10
    # 万屏用户非好友且未添加
    CAN_ADD = 20
    # 已邀请或者已添加
    STATUS_DISPLAY = 30


@unique
class InviteSource(StatusEnum):
    """
    邀请来源
    """
    NA = (0, '')
    MOBILE_LIST = (10, '通讯录好友')
    INVITE_ME = (20, '邀请我的')
    MY_INVITE = (30, '我邀请的')
    SUBORDINATE = (40, '下线邀请')
    SEARCH = (50, '来自手机号搜索')
    QR_CODE = (60, '来自扫一扫')


FRIEND_LIST_KEY = '{user_id}:friend_lists'
BLACKLIST_KEY = '{user_id}:blacklists'
